/*
 *  AMPDocument.h
 *  AMPlugin
 *
 *  Created by Toan on 6/8/12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */
#include "VCPlugInHeaders.h"
#include "CAlert.h"

//#include "IIDXMLElement.h"
//#include "IK2ServiceProvider.h"
//#include "IK2ServiceRegistry.h"
//#include "IExportProvider.h"
#include "ISelectionUtils.h"
#include "ILinkManager.h"
//#include "LinkQuery.h"

// general includes
#include <iostream>
using namespace std;

class AMPDocument/* : public CPMUnknown<ISnipRunSuite> */{
public:
	AMPDocument(IPMUnknown* boss);
	
	/** Destructor.
	*/
	virtual ~AMPDocument();
	static bool DocumentControl(bool keep_session = FALSE);
	static ErrorCode DoIDMLFileCreating(const IDFile& targetFile, bool progressDisplay=TRUE);
	static int32 exportJPEGFile(const IDFile& targetFile, bool progressDisplay=TRUE);
	static void *Wait(void *t);
	static void Stretch(uint32 nIndex,
						uchar *des,//BYTE* des, 
						uchar *src,//BYTE* src, 
						uint32 InputWidth, 
						uint32 InputHeight, 
						uint32 OutputWidth, 
						uint32 OutputHeight, 
						uint32 nPixelSize,
						bool bYUVFlag
						);
	//static bool DocumentControl(UIDRef docRef, bool keep_session = FALSE);
	static bool CheckinDocument(UIDRef docRef, bool keep_session = FALSE);
	static ErrorCode DoIDMLFileCreating(UIDRef docRef, const IDFile& targetFile, bool progressDisplay=TRUE);
	static int32 exportJPEGFile(UIDRef docRef, const IDFile& targetFile, bool progressDisplay=TRUE);
	static PMString GetImageNameFromLink(UIDRef docRef, RangeProgressBar *lpParam);
	static bool RenewLinkAnySource(UIDRef storyRef, IDataBase* database, PMString Wanted_Image_Name);
	static bool GetUIDRefImg(IDocument* iDocument);
	static bool CheckinDocsWorking(PMString FrontName);
	static void RelinkICML(IDocument* document);
	static void Relink();
	
	
private: 
	
};